<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1999-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>_gfortran_set_options (The GNU Fortran Compiler)</title>

<meta name="description" content="_gfortran_set_options (The GNU Fortran Compiler)">
<meta name="keywords" content="_gfortran_set_options (The GNU Fortran Compiler)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Non_002dFortran-Main-Program.html" rel="up" title="Non-Fortran Main Program">
<link href="_005fgfortran_005fset_005fconvert.html" rel="next" title="_gfortran_set_convert">
<link href="_005fgfortran_005fset_005fargs.html" rel="prev" title="_gfortran_set_args">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="g_t_005fgfortran_005fset_005foptions"></span><div class="header">
<p>
Next: <a href="_005fgfortran_005fset_005fconvert.html" accesskey="n" rel="next">_gfortran_set_convert</a>, Previous: <a href="_005fgfortran_005fset_005fargs.html" accesskey="p" rel="prev">_gfortran_set_args</a>, Up: <a href="Non_002dFortran-Main-Program.html" accesskey="u" rel="up">Non-Fortran Main Program</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="g_t_005fgfortran_005fset_005foptions-_002d_002d_002d-Set-library-option-flags"></span><h4 class="subsection">6.3.2 <code>_gfortran_set_options</code> &mdash; Set library option flags</h4>
<span id="index-_005fgfortran_005fset_005foptions"></span>
<span id="index-libgfortran-initialization_002c-set_005foptions"></span>

<dl compact="compact">
<dt><em>Description</em>:</dt>
<dd><p><code>_gfortran_set_options</code> sets several flags related to the Fortran
standard to be used, whether backtracing should be enabled
and whether range checks should be performed.  The syntax allows for
upward compatibility since the number of passed flags is specified; for
non-passed flags, the default value is used.  See also
see <a href="Code-Gen-Options.html">Code Gen Options</a>.  Please note that not all flags are actually
used.
</p>
</dd>
<dt><em>Syntax</em>:</dt>
<dd><p><code>void _gfortran_set_options (int num, int options[])</code>
</p>
</dd>
<dt><em>Arguments</em>:</dt>
<dd><table>
<tr><td width="15%"><var>num</var></td><td width="70%">number of options passed</td></tr>
<tr><td width="15%"><var>argv</var></td><td width="70%">The list of flag values</td></tr>
</table>

</dd>
<dt><em>option flag list</em>:</dt>
<dd><table>
<tr><td width="15%"><var>option</var>[0]</td><td width="70%">Allowed standard; can give run-time errors
if e.g. an input-output edit descriptor is invalid in a given
standard.  Possible values are (bitwise or-ed) <code>GFC_STD_F77</code> (1),
<code>GFC_STD_F95_OBS</code> (2), <code>GFC_STD_F95_DEL</code> (4),
<code>GFC_STD_F95</code> (8), <code>GFC_STD_F2003</code> (16), <code>GFC_STD_GNU</code>
(32), <code>GFC_STD_LEGACY</code> (64), <code>GFC_STD_F2008</code> (128),
<code>GFC_STD_F2008_OBS</code> (256), <code>GFC_STD_F2008_TS</code> (512),
<code>GFC_STD_F2018</code> (1024), <code>GFC_STD_F2018_OBS</code> (2048), and
<code>GFC_STD=F2018_DEL</code> (4096). Default: <code>GFC_STD_F95_OBS |
GFC_STD_F95_DEL | GFC_STD_F95 | GFC_STD_F2003 | GFC_STD_F2008 |
GFC_STD_F2008_TS | GFC_STD_F2008_OBS | GFC_STD_F77 | GFC_STD_F2018 |
GFC_STD_F2018_OBS | GFC_STD_F2018_DEL | GFC_STD_GNU | GFC_STD_LEGACY</code>.</td></tr>
<tr><td width="15%"><var>option</var>[1]</td><td width="70%">Standard-warning flag; prints a warning to
standard error.  Default: <code>GFC_STD_F95_DEL | GFC_STD_LEGACY</code>.</td></tr>
<tr><td width="15%"><var>option</var>[2]</td><td width="70%">If non zero, enable pedantic checking.
Default: off.</td></tr>
<tr><td width="15%"><var>option</var>[3]</td><td width="70%">Unused.</td></tr>
<tr><td width="15%"><var>option</var>[4]</td><td width="70%">If non zero, enable backtracing on run-time
errors.  Default: off. (Default in the compiler: on.)
Note: Installs a signal handler and requires command-line
initialization using <code>_gfortran_set_args</code>.</td></tr>
<tr><td width="15%"><var>option</var>[5]</td><td width="70%">If non zero, supports signed zeros.
Default: enabled.</td></tr>
<tr><td width="15%"><var>option</var>[6]</td><td width="70%">Enables run-time checking.  Possible values
are (bitwise or-ed): GFC_RTCHECK_BOUNDS (1), GFC_RTCHECK_ARRAY_TEMPS (2),
GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (8), GFC_RTCHECK_POINTER (16),
GFC_RTCHECK_MEM (32), GFC_RTCHECK_BITS (64).
Default: disabled.</td></tr>
<tr><td width="15%"><var>option</var>[7]</td><td width="70%">Unused.</td></tr>
<tr><td width="15%"><var>option</var>[8]</td><td width="70%">Show a warning when invoking <code>STOP</code> and
<code>ERROR STOP</code> if a floating-point exception occurred. Possible values
are (bitwise or-ed) <code>GFC_FPE_INVALID</code> (1), <code>GFC_FPE_DENORMAL</code> (2),
<code>GFC_FPE_ZERO</code> (4), <code>GFC_FPE_OVERFLOW</code> (8),
<code>GFC_FPE_UNDERFLOW</code> (16), <code>GFC_FPE_INEXACT</code> (32). Default: None (0).
(Default in the compiler: <code>GFC_FPE_INVALID | GFC_FPE_DENORMAL |
GFC_FPE_ZERO | GFC_FPE_OVERFLOW | GFC_FPE_UNDERFLOW</code>.)</td></tr>
</table>

</dd>
<dt><em>Example</em>:</dt>
<dd><div class="example">
<pre class="example">  /* Use gfortran 4.9 default options.  */
  static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31};
  _gfortran_set_options (9, &amp;options);
</pre></div>
</dd>
</dl>


<hr>
<div class="header">
<p>
Next: <a href="_005fgfortran_005fset_005fconvert.html" accesskey="n" rel="next">_gfortran_set_convert</a>, Previous: <a href="_005fgfortran_005fset_005fargs.html" accesskey="p" rel="prev">_gfortran_set_args</a>, Up: <a href="Non_002dFortran-Main-Program.html" accesskey="u" rel="up">Non-Fortran Main Program</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
